﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RelatorioCategoria.aspx.cs" Inherits="SFsoftSite.Relatorios.RelatorioCategoria" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1 style="padding-left:30px">
        Relatório de Categorias mais Aderidas
    </h1>
    <br />
    <table style="border:2px solid #a1a1a1; border-radius:15px;" align="center">
    <tr>
        <td>
            <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" 
                Height="600px" Width="800px">
                <Series>
                    <asp:Series Name="Categorias mais Aderidas" XValueMember="Nome" 
                        YValueMembers="Jogos" Legend="Legend1">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea1">
                        <AxisY Title="Quantidade de jogos" TitleFont="Arial, 14.25pt, style=Bold">
                        </AxisY>
                        <AxisX Title="Nome da Categoria" TitleFont="Arial, 14.25pt, style=Bold">
                        </AxisX>
                    </asp:ChartArea>
                </ChartAreas>
                <Legends>
                    <asp:Legend Name="Legend1">
                    </asp:Legend>
                </Legends>
            </asp:Chart>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SFGameStoreBD.mdf;Integrated Security=True;User Instance=True" 
        
            
                
                SelectCommand="SELECT Categoria.Nome, COUNT(Jogos.ID) AS Jogos FROM Jogos INNER JOIN Categoria ON Jogos.Categoria = Categoria.ID GROUP BY Categoria.Nome ORDER BY Jogos DESC" 
                ProviderName="System.Data.SqlClient">
            </asp:SqlDataSource>
        </td>
    </tr>
</table>
    <br />
    <br />
</asp:Content>
